//
//  BDMDownloadFileModel.m
//  iJobs
//
//  Created by zhengyueming on 15-4-17.
//  Copyright (c) 2015年 liyingpeng. All rights reserved.
//

#import "BDMDownloadFileModel.h"

#define CacheDirectory [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0]
#define DownloadDefaultPath [NSString stringWithFormat:@"%@/BDMDownloadFiles",                        CacheDirectory]

@implementation BDMDownloadFileModel

- (instancetype)init
{
    self = [super init];
    if (self) {
        NSError *error = nil;
        if (![[NSFileManager defaultManager] fileExistsAtPath:DownloadDefaultPath]) {
            if ([[NSFileManager defaultManager] createDirectoryAtPath:DownloadDefaultPath
                                          withIntermediateDirectories:YES
                                                           attributes:nil
                                                                error:&error]) {
            }
        }
        _fileName = @"default";
        _downloadPath = DownloadDefaultPath;
        _resumeDownload = YES;
        _SSL = NO;
    }
    return self;
}

@end
